<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>AR Management</title>
</head>
<body>
<div class="container-fluid my-5">
    <h1 class="mb-4">AR Management</h1>
    <form>
        <div class="row g-3 align-items-end d-xl-flex my-3" id="arDetailCondition">

        </div>
    </form>
    <div id="arDetailOperation" role="group" class="btn-group" aria-label="organization">
    </div>
    <table class="table table-striped" id="arDetailTable">
        <thead>
        </thead>
        <tbody>
        </tbody>
    </table>
    <div id="pagination" class="d-flex justify-content-between align-items-center pagination"></div>
</div>

<div class="modal fade" id="arDetailModal" tabindex="-1" aria-labelledby="modalLabel" aria-hidden="true">
    <div class="modal-dialog  modal-fullscreen">
        <form id="arDetailDataForm" class="modal-content needs-validation" novalidate>
            <div class="modal-header">
                <h5 class="modal-title" id="modalLabel">Add AR</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body  row">
                <input type="hidden" id="arDetailId"/>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Cancel</button>
                <button type="button" class="btn btn-primary" id="saveArDetailBtn"> Save</button>
            </div>
        </form>
    </div>
</div>

<div class="offcanvas offcanvas-end" style="width: 50rem" tabindex="-1" id="subtable">
    <div class="offcanvas-body">
        <div class="card">
            <div class="card-body">
                <h5 class="card-title">AR Charge</h5>
                <div style="overflow: auto;max-height: 40rem;">
                    <table id="chargeTable" class="table table-striped">
                    </table>
                </div>
            </div>
            <div class="card-body">
                <h5 class="card-title">AP Charge</h5>
                <div style="overflow: auto;max-height: 40rem;">
                    <table id="chargeTable2" class="table table-striped">
                    </table>
                </div>
            </div>
            <div class="card-footer">
                <div class="row">
                    <div class="col">
                        <strong>Revenue:</strong> <span id="stat_revenue" class="text-success">22</span>
                    </div>
                    <div class="col">
                        <strong>Cost:</strong> <span id="stat_cost" class="text-danger">22</span>
                    </div>
                    <div class="col">
                        <strong>Profit:</strong> <span id="stat_profit" class="text-primary">22</span>
                    </div>
                    <div class="col">
                        <strong>Profit Margin:</strong> <span id="stat_margin" class="text-info">33</span>%
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="uploadQuoteFile" tabindex="-1" aria-labelledby="upload quote file" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-centered">
        <div class="modal-content">
            <form action="/rate/excel" id="uploadForm" method="post" enctype="multipart/form-data">
                <div class="modal-header">
                    <h5 class="modal-title">AR import</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <div class="mb-3">
                        When you use csv file, will remove check the restraint of charge.
                    </div>
                    <div class="mb-3">
                        <label for="formFile" class="form-label">Choose a file</label>
                        <input class="form-control" type="file" id="formFile" name="file" accept=".csv , .xslx, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"" required>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Upload</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="../js/common.js"></script>
<script src="js/ar.js"></script>
</body>
</html>